import request from '@/request'
import { C2B } from '@/utils/wordtransfer.js'

// 查询搜索并分页
export const findPages = (data) => {
    return request.post('/special/code/list', data)
}

// id查询明细
export const getById = (id) => {
    return request.post(`/special/code/get/${id}`, {})
}

// 创建兑换码
export const createBatchCode = (data) => {
    return request.post('/special/code/create', data)
}

// 批量彻底删除
export const batchRemoves = (ids) => {
    return request.post('/special/code/batch/remove', { ids })
}

// 物理删除
export const removeById = (id) => {
    return request.post(`/special/code/remove/${id}`, {})
}


// 修改状态
export const updateStatus = (id, field, value) => {
    field = C2B(field)
    return request.post(`/special/code/status/${id}/${field}?value=${value}`, {})
}
